package yawning.mew.bear;

import yawning.mew.sim.SimulationEvent;

public class StampedeEvent extends SimulationEvent {
	BearThreatSimulator mState;
	private double mStampedeHaste;

	StampedeEvent(BearThreatSimulator state) {
		super(state.mSimEngine);

		mState = state;
		mStampedeHaste = 1 + mState.mModel.mToon.getTalent(BearModel.STAMPEDE) * 0.15;
	}

	public void onTrigger() {
		if (mStampedeHaste > 1.0) {
			if (mState.mIsLogging) mState.mLog.log("Stampede\n");

			mState.mModel.multiplyMeleeHaste(mStampedeHaste);

			schedule(mState.mModel.stampedeBuffDuration);
		}
	}

	@Override
	public void onExpire() {
		mState.mModel.multiplyMeleeHaste(1.0f / mStampedeHaste);

		if (mState.mIsLogging) mState.mLog.log("Stampede Expiration\n");
	}
}
